package com.project.common;

/**
 * @program: seata-at
 * @description: 返回类
 * @author: mml
 * @create: 2023/12/19
 */
public class RespResult {

    private Integer code;
    private String message;
    private Object data;


    public static RespResult success(String message) {
        return new RespResult(200, message, null);
    }

    public static RespResult success(String message, Object data) {
        return new RespResult(200, message, data);
    }

    public static RespResult error(String message) {
        return new RespResult(500, message, null);
    }

    public static RespResult error(String message, Object data) {
        return new RespResult(500, message, data);
    }


    public RespResult() {
    }

    public RespResult(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
